package cl.biobio.sisGestion.servicios
{
	import mx.controls.Alert;
	import mx.rpc.events.FaultEvent;
	
	public class CausaBasicaService extends GenericService
	{
		public function CausaBasicaService()
		{
			super();
			this.destination="CausaBasicaService";
            this.source="services.CausaBasicaService";//indica que clase del servidor voy a invocar
            this.addEventListener(FaultEvent.FAULT,errorHandler);//agrego un listener para escuchar los errores  
		}
		//error comunicando con visual studio
		public function errorHandler(event:FaultEvent):void
        {
        	Alert.show("Error comunicando con CausaBasicaService\n\n"+event.fault.faultString,"Error");
       	}
              
        //envia el objeto empresa a visual  
        public function agregarCausasBasicas(causasbasicas:Object):int
        {
        	
        	this.getOperation("agregarCausasBasicas").send(causasbasicas);
        	
        	return 0;
        }
        
        public function obtenerTodasCausasBasicas(numeroinforme:String):Array
        {
            this.getOperation("obtenerTodasCausasBasicas").send(numeroinforme);
            return null;
        }
        
          public function obtenerCausaBasica(Ncausabasica:String, Ninforme:String ):void
        {
            this.getOperation("obtenerCausaBasica").send(Ncausabasica, Ninforme);

        }
        
        //modificar empresa
        public function modificarCausaBasica(causabasica:Object):int
		{
			this.getOperation("modificarCausaBasica").send(causabasica);
			return 0;
		}
        
        //modificar empresa
        public function eliminarCausaBasica(Ncausabasica:String, Ninforme:String):int
		{
			this.getOperation("eliminarCausaBasica").send(Ncausabasica, Ninforme);
			return 0;
		}
        
	}
}
